package com.dd.common.data

import com.dd.utils.MMKVUtil
import java.util.HashSet

object UserData {
    private val DEVICE_DI = "DeviceId"
    private val TOKEN = "token"
    private val COOKIES = "cookies"
    fun getPhoneDeviceId(): String {
        return MMKVUtil.getInstance().getString(DEVICE_DI) ?: ""
    }

    fun setPhoneDeviceId(id: String) {
        MMKVUtil.getInstance().save(DEVICE_DI, id)
    }

    fun getToken(): String {
        return MMKVUtil.getInstance().getString(TOKEN) ?: ""
    }

    fun setToken(id: String) {
        MMKVUtil.getInstance().save(TOKEN, id)
    }

    fun getCookies(): HashSet<String> {
        return MMKVUtil.getInstance().getStringSet(COOKIES)?.toHashSet() ?: HashSet<String>()
    }

    fun setCookies(id: Set<String>) {
        MMKVUtil.getInstance().save(COOKIES, id)
    }
}